import axios from '@/utils/http';
import base from './base';

export const fn = params => axios.get(
  `${base.sq}/search`,
  {
    params: {
      select_type: params.type,
      product_id: params.spaceId,
      title: params.title,
      author: params.author,
      tags: params.tags,
      page: params.page,
      per_number: params.number, // 一页显示多少个
      order_type: params.sort,
      order_action: params.order,
    },
  },
);

export const all = params => axios.get(
  `${base.sq}/search`,
  {
    params: {
      select_type: 'All',
      title: params.title,
      page: params.page,
    },
  },
);

export const community = params => axios.get(
  `${base.sq}/search`,
  {
    params: {
      select_type: 'All',
      community_id: params.communityId,
      title: params.title,
      page: params.page,
    },
  },
);
